"""myproject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from . import views


urlpatterns = [
    # 网站首页
    url(r'^$', views.index,name="index"),
    # 网站列表页
    url(r'^list/(?P<tid>[0-9]+)$', views.list,name="list"),
    # 商品详情页
    url(r'^ginfo/(?P<gid>[0-9]+)$', views.ginfo,name="ginfo"),

    # 购物车添加
    url(r'^cartadd$', views.cartadd,name="cartadd"),
    # 购物车列表
    url(r'^cartshow$', views.cartshow,name="cartshow"),
    # 清空购物车
    url(r'^cartclear$', views.cartclear,name="cartclear"),
    # 删除购物车商品
    url(r'^cartdel$', views.cartdel,name="cartdel"),
    # 购物车修改
    url(r'^cartedit$', views.cartedit,name="cartedit"),

    # 下单操作 确认订单
    url(r'^orderadd$', views.orderadd,name="orderadd"),
    # 创建订单
    url(r'^ordercreate$', views.ordercreate,name="ordercreate"),
    # 支付
    url(r'^buy/(?P<orderid>[0-9]+)$', views.buy,name="buy"),

    # 个人订单
    url(r'^myorder$', views.myorder,name="myorder"),


    # 前台注册
    url(r'^register$', views.register,name="register"),
    url(r'^doregister$', views.doregister,name="doregister"),
    url(r'^login$', views.login,name="login"),
    url(r'^dologin$', views.dologin,name="dologin"),
]
